{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d3058a52",
   "metadata": {},
   "outputs": [],
   "source": [
    "from langchain.document_loaders import UnstructuredURLLoader\n",
    "from langchain.chains.summarize import load_summarize_chain\n",
    "from langchain.llms import OpenAI\n",
    "from langchain.text_splitter import RecursiveCharacterTextSplitter\n",
    "from langchain.prompts import PromptTemplate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "615ee4b1",
   "metadata": {
    "hide_input": false
   },
   "outputs": [],
   "source": [
    "openai_api_key = '...'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c611b91a",
   "metadata": {},
   "source": [
    "### Load up your HTML from your company page"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "69d427bb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://www.ycombinator.com/companies/poly\n",
      "You have 1 document(s)\n"
     ]
    }
   ],
   "source": [
    "def get_company_page(company_path):\n",
    "    y_combinator_url = f\"https://www.ycombinator.com{company_path}\"\n",
    "    \n",
    "    print (y_combinator_url)\n",
    "\n",
    "    loader = UnstructuredURLLoader(urls=[y_combinator_url])\n",
    "    return loader.load()\n",
    "\n",
    "\n",
    "# Get the data of the company you're interested in\n",
    "data = get_company_page(\"/companies/poly\")\n",
    "    \n",
    "print (f\"You have {len(data)} document(s)\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "cf5c4961",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Preview of your data:\n",
      "\n",
      "Accelerator\n",
      "\n",
      "About\n",
      "\n",
      "Apply\n",
      "\n",
      "FAQ\n"
     ]
    }
   ],
   "source": [
    "print (f\"Preview of your data:\\n\\n{data[0].page_content[:30]}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "d0fdfece",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Split up the texts so you don't run into token limits\n",
    "text_splitter = RecursiveCharacterTextSplitter(\n",
    "    # Set a really small chunk size, just to show.\n",
    "    chunk_size = 800,\n",
    "    chunk_overlap  = 0\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "a9e30ed0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You now have 3 documents\n"
     ]
    }
   ],
   "source": [
    "docs = text_splitter.split_documents(data)\n",
    "\n",
    "print (f\"You now have {len(docs)} documents\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "515de61f",
   "metadata": {},
   "source": [
    "### Write your custom prompt templates\n",
    "These will be used for your specific use case:\n",
    "\n",
    "1. `map_prompt` will be the prompt that is done on your first pass of your documents\n",
    "2. `combine_prompt` will be the prompt that is used when you combine the outputs of your map pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "fb34ba34",
   "metadata": {},
   "outputs": [],
   "source": [
    "map_prompt = \"\"\"Below is a section of a website about {prospect}\n",
    "\n",
    "Write a concise summary about {prospect}. If the information is not about {prospect}, exclude it from your summary.\n",
    "\n",
    "{text}\n",
    "\n",
    "% CONCISE SUMMARY:\"\"\"\n",
    "map_prompt_template = PromptTemplate(template=map_prompt, input_variables=[\"text\", \"prospect\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "481b1fe2",
   "metadata": {},
   "outputs": [],
   "source": [
    "combine_prompt = \"\"\"\n",
    "Your goal is to write a personalized outbound email from {sales_rep}, a sales rep at {company} to {prospect}.\n",
    "\n",
    "A good email is personalized and combines information about the two companies on how they can help each other.\n",
    "Be sure to use value selling: A sales methodology that focuses on how your product or service will provide value to the customer instead of focusing on price or solution.\n",
    "\n",
    "% INFORMATION ABOUT {company}:\n",
    "{company_information}\n",
    "\n",
    "% INFORMATION ABOUT {prospect}:\n",
    "{text}\n",
    "\n",
    "% INCLUDE THE FOLLOWING PIECES IN YOUR RESPONSE:\n",
    "- Start the email with the sentence: \"We love that {prospect} helps teams...\" then insert what they help teams do.\n",
    "- The sentence: \"We can help you do XYZ by ABC\" Replace XYZ with what {prospect} does and ABC with what {company} does \n",
    "- A 1-2 sentence description about {company}, be brief\n",
    "- End your email with a call-to-action such as asking them to set up time to talk more\n",
    "\n",
    "% YOUR RESPONSE:\n",
    "\"\"\"\n",
    "combine_prompt_template = PromptTemplate(template=combine_prompt, input_variables=[\"sales_rep\", \"company\", \"prospect\", \\\n",
    "                                                                         \"text\", \"company_information\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "340842c5",
   "metadata": {},
   "outputs": [],
   "source": [
    "company_information = \"\"\"\n",
    "* RapidRoad helps product teams build product faster\n",
    "* We have a platform that allows product teams to talk more, exchange ideas, and listen to more customers\n",
    "* Automated project tracking: RapidRoad could use machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. This could help product teams stay on track and deliver faster results.\n",
    "* Collaboration tools: RapidRoad could offer built-in collaboration tools, such as shared task lists, real-time messaging, and team calendars. This would make it easier for teams to communicate and work together, even if they are in different locations or time zones.\n",
    "* Agile methodology support: RapidRoad could be specifically designed to support agile development methodologies, such as Scrum or Kanban. This could include features like sprint planning, backlog management, and burndown charts, which would help teams stay organized and focused on their goals.\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82406bae",
   "metadata": {},
   "source": [
    "### LangChain Magic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "32f28761",
   "metadata": {},
   "outputs": [],
   "source": [
    "llm = OpenAI(temperature=.7, openai_api_key=openai_api_key)\n",
    "\n",
    "chain = load_summarize_chain(llm,\n",
    "                             chain_type=\"map_reduce\",\n",
    "                             map_prompt=map_prompt_template,\n",
    "                             combine_prompt=combine_prompt_template,\n",
    "                             verbose=True\n",
    "                            )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "5b556562",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\u001b[1m> Entering new MapReduceDocumentsChain chain...\u001b[0m\n",
      "Prompt after formatting:\n",
      "\u001b[32;1m\u001b[1;3mBelow is a section of a website about Poly\n",
      "\n",
      "Write a concise summary about Poly. If the information is not about Poly, exclude it from your summary.\n",
      "\n",
      "Accelerator\n",
      "\n",
      "About\n",
      "\n",
      "Apply\n",
      "\n",
      "FAQ\n",
      "\n",
      "People\n",
      "\n",
      "YC Blog\n",
      "\n",
      "Companies\n",
      "\n",
      "Startup Directory\n",
      "\n",
      "Top Companies\n",
      "\n",
      "Founder Directory\n",
      "\n",
      "Launch YC\n",
      "\n",
      "Startup Jobs\n",
      "\n",
      "All Jobs\n",
      "\n",
      "Engineering\n",
      "\n",
      "Operations\n",
      "\n",
      "Marketing\n",
      "\n",
      "Sales\n",
      "\n",
      "Career Coaching\n",
      "\n",
      "Pioneer Program 2023\n",
      "\n",
      "Startup Job Guide\n",
      "\n",
      "YC Startup Jobs Blog\n",
      "\n",
      "Upcoming Events\n",
      "\n",
      "Startup School\n",
      "\n",
      "About\n",
      "\n",
      "Co-Founder Matching\n",
      "\n",
      "Startup School Blog\n",
      "\n",
      "Library\n",
      "\n",
      "SAFE\n",
      "\n",
      "Resources\n",
      "\n",
      "Event Calendar\n",
      "\n",
      "Newsletter\n",
      "\n",
      "For Investors\n",
      "\n",
      "Hacker News\n",
      "\n",
      "Open main menu\n",
      "\n",
      "Apply for S2023 batch.\n",
      "\n",
      "Apply\n",
      "\n",
      "Home\n",
      "\n",
      "Companies\n",
      "\n",
      "Poly\n",
      "\n",
      "Poly\n",
      "\n",
      "Generate Design Assets in Seconds\n",
      "\n",
      "Y Combinator LogoS22\n",
      "\n",
      "Active\n",
      "\n",
      "Artificial Intelligence\n",
      "\n",
      "Design Tools\n",
      "\n",
      "Generative AI\n",
      "\n",
      "Consumer\n",
      "\n",
      "API\n",
      "\n",
      "Company\n",
      "\n",
      "Jobs\n",
      "\n",
      "News\n",
      "\n",
      "https://withpoly.com/\n",
      "\n",
      "Generate Design Assets in Seconds\n",
      "\n",
      "% CONCISE SUMMARY:\u001b[0m\n",
      "Prompt after formatting:\n",
      "\u001b[32;1m\u001b[1;3mBelow is a section of a website about Poly\n",
      "\n",
      "Write a concise summary about Poly. If the information is not about Poly, exclude it from your summary.\n",
      "\n",
      "Generate unlimited customizable, 4K, and commercially-licensed creative design assets of any kind with a simple text prompt.\n",
      "\n",
      "Latest News\n",
      "\n",
      "Y Combinator-backed Poly uses AI to generate art assets • TechCrunch\n",
      "\n",
      "Dec 27, 2022\n",
      "\n",
      "Jobs at Poly\n",
      "\n",
      "View all jobs →\n",
      "\n",
      "Founding ML Engineer - Co-founder level role at a YC startup backed by Bloomberg, Felicis, Figma, AI grant\n",
      "\n",
      "San Francisco, CA / Remote\n",
      "\n",
      "$120K - $250K\n",
      "\n",
      "0.25% - 5.00%\n",
      "\n",
      "Any (new grads ok)\n",
      "\n",
      "Apply Now\n",
      "\n",
      "Company Launches\n",
      "\n",
      "🚀 Poly - Generate Design Assets in Seconds with AI 🚀\n",
      "\n",
      "Poly enables designers to generate unlimited customizable, 4K UHD, commercially-licensed design assets with a single text command in seconds.\n",
      "\n",
      "Read Launch ›\n",
      "\n",
      "Poly\n",
      "\n",
      "Founded:\n",
      "\n",
      "2022\n",
      "\n",
      "Team Size:\n",
      "\n",
      "Location:\n",
      "\n",
      "San Francisco\n",
      "\n",
      "Active Founders\n",
      "\n",
      "Abhay Agarwal\n",
      "\n",
      "% CONCISE SUMMARY:\u001b[0m\n",
      "Prompt after formatting:\n",
      "\u001b[32;1m\u001b[1;3mBelow is a section of a website about Poly\n",
      "\n",
      "Write a concise summary about Poly. If the information is not about Poly, exclude it from your summary.\n",
      "\n",
      "I'm an AI researcher and designer, and founder of Poly. Previously a research fellow at Microsoft Research and lecturer at Stanford. BS in EECS from UC Berkeley, MS from Stanford.\n",
      "\n",
      "Abhay Agarwal\n",
      "\n",
      "Poly\n",
      "\n",
      "Sam Young\n",
      "\n",
      "Built and operated consumer and B2B SaaS businesses. Grew a computer vision startup from an idea to series A. Stanford MBA.\n",
      "\n",
      "Sam Young\n",
      "\n",
      "Poly\n",
      "\n",
      "Footer\n",
      "\n",
      "Y Combinator\n",
      "\n",
      "Programs\n",
      "\n",
      "YC Program\n",
      "\n",
      "Startup School\n",
      "\n",
      "Work at a Startup\n",
      "\n",
      "Company\n",
      "\n",
      "YC Blog\n",
      "\n",
      "Contact\n",
      "\n",
      "Press\n",
      "\n",
      "People\n",
      "\n",
      "Careers\n",
      "\n",
      "Privacy Policy\n",
      "\n",
      "Security\n",
      "\n",
      "Terms of Use\n",
      "\n",
      "Resources\n",
      "\n",
      "Startup Directory\n",
      "\n",
      "Startup Library\n",
      "\n",
      "Investors\n",
      "\n",
      "SAFE\n",
      "\n",
      "Hacker News\n",
      "\n",
      "Launch YC\n",
      "\n",
      "YC Deals\n",
      "\n",
      "Make something people want.\n",
      "\n",
      "Apply\n",
      "\n",
      "TwitterTwitter\n",
      "\n",
      "FacebookFacebook\n",
      "\n",
      "InstagramInstagram\n",
      "\n",
      "LinkedInLinkedIn\n",
      "\n",
      "YoutubeYouTube\n",
      "\n",
      "© 2023 Y Combinator.\n",
      "\n",
      "% CONCISE SUMMARY:\u001b[0m\n",
      "\n",
      "\n",
      "\u001b[1m> Entering new LLMChain chain...\u001b[0m\n",
      "Prompt after formatting:\n",
      "\u001b[32;1m\u001b[1;3m\n",
      "Your goal is to write a personalized outbound email from Greg, a sales rep at RapidRoad to Poly.\n",
      "\n",
      "A good email is personalized and combines information about the two companies on how they can help each other.\n",
      "Be sure to use value selling: A sales methodology that focuses on how your product or service will provide value to the customer instead of focusing on price or solution.\n",
      "\n",
      "% INFORMATION ABOUT RapidRoad:\n",
      "\n",
      "* RapidRoad helps product teams build product faster\n",
      "* We have a platform that allows product teams to talk more, exchange ideas, and listen to more customers\n",
      "* Automated project tracking: RapidRoad could use machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. This could help product teams stay on track and deliver faster results.\n",
      "* Collaboration tools: RapidRoad could offer built-in collaboration tools, such as shared task lists, real-time messaging, and team calendars. This would make it easier for teams to communicate and work together, even if they are in different locations or time zones.\n",
      "* Agile methodology support: RapidRoad could be specifically designed to support agile development methodologies, such as Scrum or Kanban. This could include features like sprint planning, backlog management, and burndown charts, which would help teams stay organized and focused on their goals.\n",
      "\n",
      "\n",
      "% INFORMATION ABOUT Poly:\n",
      "\n",
      "\n",
      "Poly is a design tool that uses artificial intelligence and generative AI to quickly create design assets. It is an active consumer API company that is part of the Y Combinator program.\n",
      "\n",
      "\n",
      "\n",
      "Poly is an AI-based platform that enables designers to generate unlimited customizable, 4K UHD, commercially-licensed design assets with a single text command in seconds. It was founded in 2022 by Abhay Agarwal and is located in San Francisco. Y Combinator and Bloomberg have invested in the project.\n",
      "\n",
      "\n",
      "\n",
      "Poly is an AI research and design company founded by Abhay Agarwal, a research fellow at Microsoft Research and lecturer at Stanford. The company is also operated by Sam Young, a former computer vision startup founder with an MBA from Stanford. Poly is affiliated with Y Combinator, a program that helps entrepreneurs make something people want.\n",
      "\n",
      "% INCLUDE THE FOLLOWING PIECES IN YOUR RESPONSE:\n",
      "- Start the email with the sentence: \"We love that Poly helps teams...\" then insert what they help teams do.\n",
      "- The sentence: \"We can help you do XYZ by ABC\" Replace XYZ with what Poly does and ABC with what RapidRoad does \n",
      "- A 1-2 setenece description about RapidRoad, be brief\n",
      "- End your email with a call-to-action such as asking them to set up time to talk more\n",
      "\n",
      "% YOUR RESPONSE:\n",
      "\u001b[0m\n",
      "\n",
      "\u001b[1m> Finished chain.\u001b[0m\n",
      "\n",
      "\u001b[1m> Finished chain.\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "output = chain({\"input_documents\": docs, # The seven docs that were created before\n",
    "                \"company\": \"RapidRoad\", \\\n",
    "                \"company_information\" : company_information,\n",
    "                \"sales_rep\" : \"Greg\", \\\n",
    "                \"prospect\" : \"Poly\"\n",
    "               })"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "c3152c06",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Dear GitLab Team,\n",
      "\n",
      "We love that GitLab helps teams collaborate, plan, and manage projects, while also providing visibility and consistent controls for security and compliance. We believe that RapidRoad could help you take your DevOps processes to the next level. \n",
      "\n",
      "RapidRoad is a platform that helps product teams build faster. We have tools like automated project tracking, collaboration tools, and agile methodology support that could help your teams stay on track and deliver faster results.\n",
      "\n",
      "We believe that combining GitLab and RapidRoad would unlock your organization from the constraints of the current toolchain. We would love to set up a time to discuss how we can help each other and how we can help you improve your DevOps processes.\n",
      "\n",
      "Thank you for your time,\n",
      "\n",
      "Greg \n",
      "Sales Rep at RapidRoad\n"
     ]
    }
   ],
   "source": [
    "print (output['output_text'])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5491e5bb",
   "metadata": {},
   "source": [
    "### Rinse and Repeat: Loop Through Companies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "ddf9a955",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "70e22389",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_companies = pd.read_clipboard()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "fca1ffb3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Link</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Findly</td>\n",
       "      <td>/companies/findly</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Maya Labs</td>\n",
       "      <td>/companies/maya-labs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Phind</td>\n",
       "      <td>/companies/phind</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Juicebox</td>\n",
       "      <td>/companies/juicebox</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Penguin AI</td>\n",
       "      <td>/companies/penguin-ai</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Poly</td>\n",
       "      <td>/companies/poly</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Olli.ai</td>\n",
       "      <td>/companies/olli-ai</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Name                   Link\n",
       "0      Findly      /companies/findly\n",
       "1   Maya Labs   /companies/maya-labs\n",
       "2       Phind       /companies/phind\n",
       "3    Juicebox    /companies/juicebox\n",
       "4  Penguin AI  /companies/penguin-ai\n",
       "5        Poly        /companies/poly\n",
       "6     Olli.ai     /companies/olli-ai"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_companies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "094bb943",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1. Findly\n",
      "https://www.ycombinator.com/companies/findly\n",
      "\n",
      "Dear Findly Team,\n",
      "\n",
      "We love that Findly helps teams quickly and accurately access data insights without having to learn SQL or Python. We can help you provide more actionable insights by using our platform to talk more, exchange ideas, and listen to more customers. \n",
      "\n",
      "RapidRoad is a platform that helps product teams build product faster. It offers automated project tracking, collaboration tools, and agile methodology support to help teams stay organized and deliver faster results. \n",
      "\n",
      "We believe that our platform and your AI chatbot will be a great combination to help teams develop products faster and with actionable insights. Let's talk soon and see how we can work together to make this happen. \n",
      "\n",
      "Best, \n",
      "Greg \n",
      "Sales Rep, RapidRoad\n",
      "\n",
      "\n",
      "\n",
      "2. Maya Labs\n",
      "https://www.ycombinator.com/companies/maya-labs\n",
      "\n",
      "Dear Maya Labs, \n",
      "\n",
      "We love that Maya Labs helps teams build custom software in minutes using natural language. We at RapidRoad are dedicated to helping product teams build their products faster. We can help you build custom software faster by providing automated project tracking, collaboration tools, and agile methodology support.\n",
      "\n",
      "Our platform allows product teams to talk more, exchange ideas, and listen to more customers. We have machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. We also offer built-in collaboration tools, such as shared task lists, real-time messaging, and team calendars. Finally, we are specifically designed to support agile development methodologies, such as Scrum or Kanban.\n",
      "\n",
      "We believe that our platform can help Maya Labs build custom software faster and with higher quality. Let's set up a time to talk more about how we can help each other.\n",
      "\n",
      "Best,\n",
      "Greg \n",
      "RapidRoad Sales Rep\n",
      "\n",
      "\n",
      "\n",
      "3. Phind\n",
      "https://www.ycombinator.com/companies/phind\n",
      "\n",
      "Dear Michael and Justin, \n",
      "\n",
      "We love that Phind helps teams find the technical answers they need quickly and easily. At RapidRoad, we want to help product teams build faster, smarter and more efficiently. We can help you do this by providing an automated project tracking platform, collaboration tools, and agile methodology support. \n",
      "\n",
      "RapidRoad is a platform that allows product teams to talk more, exchange ideas, and listen to more customers. Our platform uses machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. We also offer built-in collaboration tools like shared task lists, real-time messaging, and team calendars, as well as agile methodology support like sprint planning, backlog management, and burndown charts. \n",
      "\n",
      "We would love to discuss further how we can help your team to build faster, smarter and more efficiently. Please let me know when is the best time for us to have a call to discuss this further. \n",
      "\n",
      "Regards,\n",
      "\n",
      "Greg \n",
      "RapidRoad\n",
      "\n",
      "\n",
      "\n",
      "4. Juicebox\n",
      "https://www.ycombinator.com/companies/juicebox\n",
      "\n",
      "Dear Ishan and David, \n",
      "\n",
      "We love that Juicebox helps teams find pre-vetted independent contractors quickly and efficiently in a zero-commission marketplace. We at RapidRoad are passionate about helping product teams build products faster and more efficiently. We can help you do this by providing a platform that allows product teams to talk more, exchange ideas, and listen to more customers, as well as providing automated project tracking, collaboration tools, and agile methodology support. \n",
      "\n",
      "At RapidRoad, we believe that teams should be able to work together efficiently and effectively, and our platform is specifically designed to help them do just that. \n",
      "\n",
      "We would love to learn more about what you need to help your team succeed and see how RapidRoad can help. When would be a good time for us to connect and discuss further? \n",
      "\n",
      "Best, \n",
      "Greg \n",
      "Sales Rep, RapidRoad\n",
      "\n",
      "\n",
      "\n",
      "5. Penguin AI\n",
      "https://www.ycombinator.com/companies/penguin-ai\n",
      "\n",
      "Dear Rohan Doshi,\n",
      "\n",
      "We love that Penguin AI helps teams create agency-quality visual assets quickly and affordably. At RapidRoad, we help product teams build products faster. Our platform allows product teams to talk more, exchange ideas, and listen to more customers. We also have automated project tracking and collaboration tools, as well as support for agile methodology. \n",
      "\n",
      "We can help you save time and money by providing the tools and resources to create high-quality visual assets quickly and cost-effectively. Our platform allows product teams to communicate and work together, even if they are in different locations or time zones, and stay on track and deliver faster results.\n",
      "\n",
      "I would love to learn more about your product and how we can help each other. Would you be available for a call next week to discuss further?\n",
      "\n",
      "Best,\n",
      "\n",
      "Greg\n",
      "RapidRoad\n",
      "\n",
      "\n",
      "\n",
      "6. Poly\n",
      "https://www.ycombinator.com/companies/poly\n",
      "\n",
      "Dear Poly Team,\n",
      "\n",
      "We love that Poly helps teams generate customizable, 4K, and commercially-licensed creative design assets with a simple text prompt. We believe that RapidRoad can help you create and collaborate more effectively by offering automated project tracking, collaboration tools, and agile methodology support.\n",
      "\n",
      "RapidRoad is a platform that helps product teams build product faster. We have a suite of tools to help product teams talk more, exchange ideas, and listen to more customers. We provide automated project tracking, which uses machine learning algorithms to automatically track project progress, identify potential bottlenecks, and suggest ways to optimize workflows. Our collaboration tools include shared task lists, real-time messaging, and team calendars, which makes it easier for teams to communicate and work together, even if they are in different locations or time zones. RapidRoad is also specifically designed to support agile development methodologies, such as Scrum or Kanban, with features like sprint planning, backlog management, and burndown charts to help teams stay organized and focused on their goals.\n",
      "\n",
      "I would love to learn more about Poly and discuss how RapidRoad can help your team create and collaborate more effectively. Please let me know if you’d like to set up a time to\n",
      "\n",
      "\n",
      "\n",
      "7. Olli.ai\n",
      "https://www.ycombinator.com/companies/olli-ai\n",
      "We love that Olli.ai helps teams generate insights quickly and efficiently through powerful AI models. We can help you do this by automating project tracking, providing collaboration tools, and supporting agile methodology. \n",
      "\n",
      "RapidRoad is a platform that helps product teams build product faster by allowing them to talk more, exchange ideas, and listen to more customers.\n",
      "\n",
      "We believe that our combination of services can provide immense value to your company and would love to discuss more about how we can work together. Would you be interested in setting up some time to talk? We look forward to hearing from you.\n",
      "\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "for i, company in df_companies.iterrows():\n",
    "    print (f\"{i + 1}. {company['Name']}\")\n",
    "    page_data = get_company_page(company['Link'])\n",
    "    docs = text_splitter.split_documents(page_data)\n",
    "\n",
    "    output = chain({\"input_documents\": docs, \\\n",
    "                \"company\":\"RapidRoad\", \\\n",
    "                \"sales_rep\" : \"Greg\", \\\n",
    "                \"prospect\" : company['Name'],\n",
    "                \"company_information\" : company_information\n",
    "               })\n",
    "    \n",
    "    print (output['output_text'])\n",
    "    print (\"\\n\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5d037f61",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
